#ifndef RFID_INTELL_H
#define RFID_INTELL_H

#include <QWidget>
#include "display_data.h"
#include <QStandardItemModel>
#include "API_HeaderFile/uhf.h"
#include "API_HeaderFile/uhf_config.h"
#include "API_HeaderFile/typedef.h"
#include "API_HeaderFile/uhf_constants.h"
#include "API_HeaderFile/uhf_internal.h"
#include <windows.h>
#include <QDebug>
#include <winreg.h>
#include <QTime>
#include <QEvent>
#include <QKeyEvent>
#include "uart_serial.h"
#define _ACRTIMP __declspec(dllimport)
#define _tcstoul    wcstoul
namespace Ui {
class rfid_intell;
}
enum {
        RFID_RESPONSE_MODE_COMPACT = 0x00000001,
        RFID_RESPONSE_MODE_NORMAL = 0x00000003,
        RFID_RESPONSE_MODE_EXTENDED = 0x00000007
        };
typedef enum
{
    EPC_BTN_WRITE_CLICK,
    USER_BTN_WRITE_CLICK,
}TAG_WRITE_BUTTON_CLICK;

typedef enum
{
    EPC_BTN_READ_CLICK,
    TID_BTN_READ_CLICK,
    USER_BTN_READ_CLICK,
}TAG_READ_BUTTON_CLICK;


class rfid_intell : public QWidget
{
    Q_OBJECT

public:
    explicit rfid_intell(QWidget *parent = 0);
    ~rfid_intell();

    void frame();

    int Base_init();

   static int rm70xxUsrCallback(int status, int type, unsigned char *data, int dataLen);

    static void hexc_to_charc(unsigned char *in_dat, int len, unsigned char *out_dat);

    static void hex_conv_Char(unsigned char* pHex, unsigned char *pChar);

    int Ready_To_Write(TAG_WRITE_BUTTON_CLICK ClickNum);

    int String2Char(QString str, unsigned char *_char);

    int Ready_To_Read(TAG_READ_BUTTON_CLICK ClickNum);

    void event_tablewidget_init();

    static void send_slots(QString,int);

    int postMessageCommand(QString);

    int timess;

    LRESULT getModuleBaseInfo(WPARAM iParam1, LPARAM iParam2);

    int  TCharToChar(const TCHAR *tchar, char *_char);

    void AUTO_CMDREAD();

    void AUTO_CHECK(QString);

signals:
    void read_data_send(QString mmp);

    void AUTO_read();

    void AUTO_judge(QString);

private slots:
    void OPTION_judge(QString);

     void OPTION_read();

     void keyPressEvent(QKeyEvent *event);

     void show_data(QString data);

    void on_open_com_pb_clicked();

    void on_read_pb_clicked();

    void on_write16_pb_clicked();

    void on_auto_start_pb_clicked();

    void on_auto_stop_pb_clicked();

    void on_close_com_pb_clicked();

    void on_redinfrcheck_clicked();

    void on_pushButton_clicked();

    void on_write_pb_clicked();

    void on_COM_START_PB_clicked();

    void on_COM_STOP_PB_clicked();

private:
    Ui::rfid_intell *ui;

    bool gDeviceConnectStatus;

    int mRFModule;

    class uart_serial * m_uart;




};
static rfid_intell * m_rfid_data;
//int rm70xxUsrCallback(int status, int type, unsigned char *data, int dataLen);
#endif // RFID_INTELL_H
